<?php
/*
 * Created on 08.03.2006
 *
 */

/**
 * attributes:
 * bundle required; bundle to load from the modules bundles folder
 * bind optional; Name to bind bundle to
 * locale optional; Locale to bind
 *  
 */ 
class fmt_loadBundleHandler 
{

    function startElement (& $sender, $attrs, $line)
    {
        if (empty($attrs['bundle']))
            die ("Attribute bundle is missing in fmt:loadBundle in line ".$line."!\n");
        if (empty($attrs['bind']))
            $attrs['bind'] = "'stdBundle'";
        $sender->appendCode('$actionform->set('.$attrs['bind'].', phpinchains_util_BundleTool::loadBundle($dispatcher->basedir."bundles/".'.
            $attrs['bundle'].', $actionform->get("__pspLocale")));'."\n");
    }
    
    function endElement (& $sender)
    {
    }

}

?>